package com.hzhr.iot.log.controller.base;

import com.hzhr.iot.log.model.log.LogModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

@Component
public class BaseController {
    @Autowired
    HttpServletRequest request;

    protected String getTokenId() {
        String tokenId = request.getHeader("token_id");

        return tokenId;
    }

//    protected TokenModel getTokenModel() {
//        TokenModel tokenId = (TokenModel)request.getAttribute("tokenModel");
//
//        return tokenId;
//    }

    protected String getTransactionId() {
        String tokenId = (String)request.getAttribute("transactionId");

        return tokenId;
    }

    protected LogModel getLogModel() {
        LogModel logModel = (LogModel)request.getAttribute("logModel");

        return logModel;
    }
}
